package com.mydistibute.distibutelearn.threadsafe;

/**
 * @author victorydeng
 * @Classname ThreadProblem
 * @Description TODO
 * @Date 2020/5/27 14:29
 * @Created by victorydeng
 */
public class ThreadProblem {
    volatile static boolean stop = false;

    public static void main(String[] args) throws InterruptedException {
        Thread thread=new Thread(()->{
            int i=0;
            while(!stop){
                i++;
                synchronized (ThreadProblem.class){

                }

            }
        });
        thread.start();
        Thread.sleep(1000);
        stop=true;
    }
}
